<?php defined('SYSPATH') OR die('No direct access allowed.'); ?>

<script type="text/javascript">
$(document).ready(function() {

	$(".actionView").click(function() {
		var uri = $(this).attr('href'); 
		if (uri==='') {
			alert('ไม่มีข้อมูลเพลง');
		}
		else {
			ISS.Popup.Windows.Show_Modal("View Song", uri, null, 280, 320, null);		
		}
		return false;
	});
	
}); 
</script>

<?php 	
	echo html::Stylesheet(
		array
		(
			'media/css/search_block.css',
		),
		array
		(
			'screen',
		)
	);	
?>

<div id="mainCont">

	<?php 	
		if (empty($result)) {
			echo '<h2>ยังไม่มีคลับสมาชิกให้บริการ</h2>';
		}
		else {
			echo '<h2>คลับสมาชิก</h2>';
			$i=0;
			?>
			<div id="searchBody">
			<table>
				<tr>
					<td class="header_seq">ลำดับ</td>
					<td class="header_album">คลับ</td>
					<td class="header_track">รูป</td>
					<td class="header_song">สมาชิก</td>
				</tr>
			<?php 
			foreach ($result as $row) {
				$i++;
			?>		
					<?php echo (($i % 2)==0) ? '<tr class="searchListDark">' : '<tr class="searchListLight">'; ?>
						<td class="body_seq"><?php echo $i; ?></td>
						<td class="body_album"><?php echo html::specialchars($row->name); ?></td>
						<td class="body_track"><img alt="<?php echo html::specialchars($row->name); ?>" src="<?php echo url::base() . $row->logo; ?>" height="50"></img></td>
						<td class="body_song">
			        		<a class='actionView' href="<?php echo url::base() . 'index.php/club/members/show_members/'. $row->id; ?>">
			        			<img class="imgPlay" alt="สมาชิก" src="<?php echo url::base();?>/media/images/club_icon.jpg"/>
			        		</a>
						</td>
					</tr>
				<?php 					
			}
			echo '</table>';
			echo '</div>';
		}
	
	?>
	<div id = "searchFooter">
		<?php echo $pagination; ?>
	</div>
</div>